
#ifndef	RESOURCE_CACHE_HPP
#define	RESOURCE_CACHE_HPP

#include <boost/unordered_map.hpp>
#include <boost/shared_ptr.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

class resource_cache
{
	public:

		~resource_cache( );

		sf::Image * load_image( std::string const & filename );
		sf::Image * get_image( std::string const & keyname );
		sf::SoundBuffer * load_buffer( std::string const & filename );
		sf::SoundBuffer * get_buffer( std::string const & keyname );

		void unload_images( );
		void unload_buffers();

	private:

		typedef boost::unordered_map< std::string, sf::Image * > images_t;
		typedef boost::unordered_map< std::string, sf::SoundBuffer * > buffers_t;

		images_t m_images;
		buffers_t m_buffers;
};

extern resource_cache g_cache;

#endif	//RESOURCE_CACHE_HPP
